import java.util.Scanner;

public class String_03 {
    public static void main(String[] args) {
        //简单的登录
        String username="shuzijun";
        String password="123456";
        for (int i=0;i<3;i++){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name=scanner.nextLine();
        System.out.println("请输入密码：");
        String pwd=scanner.nextLine();

        if (name.equals(username)&&pwd.equals(password)){
            System.out.println("登录成功");
            break;
        }else
        {
            System.out.println("密码错误，你还有"+(2-i)+"次机会");
        }
    }

    }
}
